In software development, dependency injection (DI) generally refers to the process of supplying an external dependency to a software component, such as a software object, using a form of inverse control. Traditionally, if an object needs a particular service, then that object is also responsible for instantiating and ultimately disposing of the service. This tends to increase the object's overall complexity. A DI framework eliminates the need for each object to manage the lifecycle of the services it invokes, and instead allows the object to maintain a reference to an implementation of the service, and then use that implementation to invoke the service's behaviors.
An example of a DI framework that enables dependencies is the OSGi (Open Services Gateway initiative) framework. OSGi defines a module system for the Java software language, and implements a dynamic component model in which applications are modularized into components or bundles. Each bundle is a tightly-coupled, dynamically loadable collection of classes, jars, and configuration files that explicitly declare their external dependencies. A services layer is used to connect bundles in a dynamic manner, by offering a publish-find-bind model for plain old Java objects (Pojo). A services registry API allows for management services, and a lifecycle API allows for lifecycle management of bundles. Applications or components provided as bundles can be remotely installed, started, stopped, updated and uninstalled, without requiring a system reboot.
Other systems provide similar functionality: for example, the OSGi Blueprint Container specification defines a service which uses XML definitions within a bundle to create and wire application objects, and also defines a dependency injection framework for bundles that accounts for the dynamic nature of services. SpringSource similarly defines a DI-like Spring Dynamic Modules (SDM) framework, which enables the use of Spring to configure both the internals of a bundle, and the references between bundles. Additional technologies that make use of, or that are related to DI include the Blueprint Services Specification as described in Request for Comments (RFC) 124, and the OSGi Bundle Repository Specification as described in RFC-112, each of which are herein incorporated by reference.
However, to date, little has been provided in the way of accommodating the variety of different DI and other frameworks in a unified manner that allows for usage and further extension of these frameworks in building new machines and new software applications. This is the general area that embodiments of the invention are intended to address.